package apiday02_homework;

import java.lang.reflect.Array;
import java.util.Arrays;

public class MatchesDemo {
    public static void main(String[] args) {
        //邮箱正则表达式
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9_]+(\\.[a-zA-Z]+)+";
        String email = "1710221351@qq.com";
        if (email.matches(regex)){
            System.out.println("匹配成功");
        }else {
            System.out.println("匹配失败");
        }

        //replaceAll
        String email1=email.replaceAll("qq", "163");
        System.out.println(email1);

        //split
        String[] arr = email.split("@");
        for (int i =0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        System.out.println(Arrays.toString(arr));

    }
}
